home *** CD-ROM | disk | FTP | other *** search
- on bosscreate
- global bosslife, bossright
- set the locV of sprite 12 to -500
- set the locH of sprite 12 to 250
- set the castNum of sprite 12 to 143
- set bosslife to 2000
- set bossright to 2
- end
-
- on bossanimate
- global bulletlist, max_bullets, bossright, bosslife
- if the locV of sprite 12 < 150 then
- set the locV of sprite 12 to the locV of sprite 12 + 5
- end if
- set the visible of sprite 12 to 1
- set the locH of sprite 12 to the locH of sprite 12 + bossright
- if the left of sprite 12 < 0 then
- set bossright to bossright + 1
- end if
- if the right of sprite 12 > 540 then
- set bossright to bossright - 1
- end if
- if bossright > 5 then
- set bossright to 5
- end if
- if bossright < -5 then
- set bossright to -5
- end if
- if random(20) = 1 then
- addlittleship()
- end if
- if random(5) = 1 then
- bossfire()
- end if
- set the ink of sprite 12 to 8
- repeat with n = 5 to 4 + max_bullets
- if sprite n intersects 12 then
- set the ink of sprite 12 to 4
- set bosslife to bosslife - 25
- set the visible of sprite n to 0
- set the locH of sprite n to 0
- setAt(bulletlist, n - 4, 0)
- end if
- end repeat
- end
-
- on bossfire
- global boss_bulletlist, boss_bullets
- repeat with n = 1 to boss_bullets
- if getAt(boss_bulletlist, n) = 0 then
- set y to abs(the locV of sprite 12 + 100 - the locV of sprite 10)
- set x to abs(the locH of sprite 12 - the locH of sprite 10)
- if x = 0 then
- set x to 0.0001
- end if
- set x to x * 1.0
- set y to y * 1.0
- set angle to atan(float(y / x))
- set h to cos(angle)
- set V to sin(angle)
- if the key = "a" then
- put "x"
- put x
- put "y"
- put y
- put "angle"
- put angle
- put "h"
- put h
- put "v"
- put V
- end if
- if the locH of sprite 10 <= the locH of sprite 12 then
- set h to -h
- end if
- if the locV of sprite 10 <= the locV of sprite 12 then
- set V to -V
- end if
- setAt(boss_bulletlist, n, birth(script "boss", n + 12, h * 15, V * 15))
- exit
- end if
- end repeat
- end
-
- on addlittleship
- global lil_list
- repeat with n = 1 to 3
- if getAt(lil_list, n) = 0 then
- setAt(lil_list, n, birth(script "lil_ship script", n + 22))
- end if
- end repeat
- end
-